//
//  OldPublicInfoCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/24.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "OldPublicInfoCell.h"
#import <UIButton+WebCache.h>

@interface OldPublicInfoCell ()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UITextField *titleLab;
@property (weak, nonatomic) IBOutlet UIButton *logoBtn;


@end

@implementation OldPublicInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.titleLab.delegate = self;
    self.titleLab.returnKeyType = UIReturnKeyDone;
}
- (IBAction)uploadClick:(UIButton *)btn
{
    if (self.uploadBtnClick) {
        self.uploadBtnClick(btn);
    }
}
- (IBAction)textFieldChanged:(UITextField *)field
{
    if (field.tag == 0) {
        self.model.title = field.text;
    }
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    
    [self.titleLab resignFirstResponder];
    
    return YES;
}
- (void)setModel:(OldActivityDetailModel *)model
{
    _model = model;
    self.titleLab.text = model.title;
    [self.logoBtn sd_setImageWithURL:[NSURL URLWithString:model.avatarUrl] forState:UIControlStateNormal placeholderImage:GetImage(@"上传图片")];
}

@end
